<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of indexActionclass
 *
 * @author wlf
 */

class Action extends tfAction {
    //put your code here
    public function indexAction() {
        
        $conn = tfDB::getConn();
        $db_manager = tfDB::getDbManager();
        //echo tfDB::singleton()->_get_dsn();
        
        //echo tfDoctrine::getPath();
        //echo "<hr>";
       
        //db test
        $stmt = $conn->prepare("select  * from members");
        
        $stmt->execute();
        $results = $stmt->fetchAll();

        //Template::assign('abc','value');

        $this->assign("testvar",'這是一個測試值');
        //$this->assign('footer','這是尾巴');
        //$this->assign('nav', 'nav example');
        //$this->display("test.html");
       
        //echo tfConfig::getConfig('default_layout')."<br>";

        ob_start();
        
        echo "index Action in indexAction.class.php<br>";
        echo "<pre>";
        echo "config app name = ".tfConfig::getConfig("app_name");
        print_r($_SERVER);
        echo "</pre>";
        echo "<hr>";
        print_r($results);
        echo "<br>";
        echo tfTemplate::getTpl()->template_dir . "<br>";
        tfRequest::printParameters();
         //throw new Exception('this is a intentionally  error exception');
        $content = ob_get_contents();
        ob_end_clean();
        //ob_end_flush();

        $this->assign("content",$content);
        $this->render_layout("index.html");

        
        
        //$this->display_layout(array('test.html','nav.html'));
        //$this->render_layout(BASE_PATH . "templates" . DS . "layout" . DS . "layout.html");
        //echo "template name = " . Template::getTplName() . "<br>";
        
    }
}
?>
